package com.qf.controller;

import com.qf.po.Hostinfo;
import com.qf.sercvice.HostinfoService;
import com.qf.vo.JsonBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HostinfoController {
    @Autowired
    private HostinfoService hostinfoService;

    @RequestMapping(value = "/hostinfos",method = RequestMethod.GET)
    public JsonBean all(){
        List<Hostinfo> finds = hostinfoService.finds();
        if (!ObjectUtils.isEmpty(finds)){
            return new JsonBean(200,"查询所有",finds);
        }
        return null;
    }
}
